'\" te
.\"  Copyright (c) 1995, Sun Microsystems, Inc.  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH TRAN_GETCAP 9E "Aug 30, 1995"
.SH NAME
tran_getcap, tran_setcap \- get/set SCSI transport capability
.SH SYNOPSIS
.nf
#include <sys/scsi/scsi.h>



\fBint prefix\fR\fBtran_getcap\fR(\fBstruct scsi_address *\fR\fIap\fR, \fBchar *\fR\fIcap\fR, \fBint\fR \fIwhom\fR);
.fi

.LP
.nf
\fBint prefix\fR\fBtran_setcap\fR(\fBstruct scsi_address *\fR\fIap\fR, \fBchar *\fR\fIcap\fR, \fBint\fR \fIvalue\fR,
     \fBint\fR \fIwhom\fR);
.fi

.SH INTERFACE LEVEL
illumos architecture specific (illumos DDI).
.SH PARAMETERS
.ne 2
.na
\fB\fIap\fR \fR
.ad
.RS 10n
Pointer to the \fBscsi_address\fR(9S) structure.
.RE

.sp
.ne 2
.na
\fB\fIcap\fR \fR
.ad
.RS 10n
Pointer to the string capability identifier.
.RE

.sp
.ne 2
.na
\fB\fIvalue\fR \fR
.ad
.RS 10n
Defines the new state of the capability.
.RE

.sp
.ne 2
.na
\fB\fIwhom\fR \fR
.ad
.RS 10n
Specifies whether all targets or only the specified target is affected.
.RE

.SH DESCRIPTION
The \fBtran_getcap()\fR and \fBtran_setcap()\fR vectors in the
\fBscsi_hba_tran\fR(9S) structure must be initialized during the \fBHBA
\fRdriver's \fBattach\fR(9E) to point to \fBHBA \fRentry points to be called
when a target driver calls \fBscsi_ifgetcap\fR(9F) and \fBscsi_ifsetcap\fR(9F).
.sp
.LP
\fBtran_getcap()\fR is called to get the current value of a capability specific
to features provided by the \fBHBA \fRhardware or driver.  The name of the
capability \fIcap\fR is the \fINULL\fR terminated capability string.
.sp
.LP
If \fIwhom\fR is non-zero, the request is for the current value of the
capability defined for the target specified by the  \fBscsi_address\fR(9S)
structure pointed to by \fIap\fR; if \fIwhom\fR is \fB0\fR, all targets are
affected; else, the target specified by the \fBscsi_address\fR structure
pointed to by \fIap\fR is affected.
.sp
.LP
\fBtran_setcap()\fR is called to set the value of the capability \fIcap\fR to
the value of \fIvalue\fR. If \fIwhom\fR is non-zero, the capability should be
set for the target specified by the \fBscsi_address\fR(9S) structure pointed to
by \fIap\fR; if \fIwhom\fR is \fB0\fR, all targets are affected; else, the
target specified by the \fBscsi_address\fR structure pointed to by \fIap\fR is
affected. It is recommended that \fBHBA \fRdrivers do not support setting
capabilities for all targets, that is, \fIwhom\fR is \fB0\fR.
.sp
.LP
A device may support only a subset of the defined capabilities.
.sp
.LP
Refer to \fBscsi_ifgetcap\fR(9F) for the list of defined capabilities.
.sp
.LP
\fBHBA \fRdrivers should use \fBscsi_hba_lookup_capstr\fR(9F) to match
\fIcap\fR against the canonical capability strings.
.SH RETURN VALUES
\fBtran_setcap()\fR must return  \fB1\fR if the capability was successfully set
to the new value, \fB0\fR if the \fBHBA \fR driver does not support changing
the capability, and  \fB\(mi1\fR if the capability was not defined.
.sp
.LP
\fBtran_getcap()\fR must return the current value of a capability or
\fB\(mi1\fR if the capability was not defined.
.SH SEE ALSO
.BR attach (9E),
.BR scsi_hba_attach (9F),
.BR scsi_hba_lookup_capstr (9F),
.BR scsi_ifgetcap (9F),
.BR scsi_address (9S),
.BR scsi_hba_tran (9S)
.sp
.LP
\fIWriting Device Drivers\fR
